<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">
    <h:form id="form-login-popup">
        <div class="login_cart">
            <div class="login">
                <p class="login_icon" />
                <div class="login_info">
                    <div>
                        <b>Client :</b> <h:outputText 
                            value="#{!customerManagedBean.securityManagedBean.loggedIn 
                                     ? ' non connecté' : customerManagedBean.securityManagedBean.customer.login}" />
                    </div>
                    <div id="pnlLoginActionButton" style="visibility: 
                         #{customerManagedBean.securityManagedBean.loggedIn ? ' hidden' : 'visible'}">
                        <h:commandLink value="LogIn" action="toLogin" /> / <h:commandLink value="Inscription" action="toRegistration" />
                    </div>
                    <div id="pnlLoginMySpaceActionButton" style="visibility: #{!customerManagedBean.securityManagedBean.loggedIn ? ' hidden' : 'visible'};position: absolute; top: 20px;">
                        <h:commandLink id="logoutLink" action="#{customerManagedBean.disconnectClick}" title="Se déconnecter">Se déconnecter</h:commandLink>
                    </div>
                </div>
            </div><!-- Login -->
            <div class="cart">
                <p class="cart_icon" />
                <div class="cart_info">
                    <p class="cart_info_row_top">
                        <b>Panier :</b>
                    </p>
                    <p class="cart_info_row_bottom">
                        <p:commandLink action="#{mbCart.affichePanier()}" value="#{mbCart.itemNumber} articles / #{mbCart.total} €"  />
                    </p>
                </div>
            </div><!-- Cart -->
        </div>
<!--    
        <p:confirmDialog id="confirmDialog" message="Êtes-vous sûr de vouloir vous déconnecter ?"  
                header="Confirmation" severity="alert" widgetVar="confirmation">  
                  
            <p:commandButton id="confirm" value="Yes" oncomplete="confirmation.hide()"  />  
            <p:commandButton id="decline" value="No" onclick="confirmation.hide();" type="button" />   

        </p:confirmDialog>
    
        <p:dialog id="dialog" header="Authentification" widgetVar="dlg" modal="true" resizable="false" closable="false">  
                <h:panelGrid columns="2" cellpadding="5">  
                    <h:outputLabel for="username" value="Login :" />  
                    <p:inputText id="username" required="true" label="username" /> 
                    <p:message id="msgUserName" for="username"/>

                    <h:outputLabel for="password" value="Mot de passe :" />  
                    <h:inputSecret id="password" required="true" label="password" />
                    <p:message id="msgPassword" for="password"/>

                    <f:facet name="footer">
                        <p:commandButton id="cancelButton" value="Annuler" onclick="dlg.hide();"
                                         immediate="true" />
                        <p:commandButton id="loginButton" value="Connexion" />
                    </f:facet>  
                </h:panelGrid>  

        </p:dialog>
    <script type="text/javascript">
        function handleLoginRequest(xhr, status, args) {  
            debugger;
            if(args.validationFailed || !args.loggedIn) {  
                dlg.jq.effect("shake", { times:5 }, 100); 
            }   
            else {  
                dlg.hide();
            }  
        }
    </script>-->
    </h:form>
    
</ui:fragment>
